#include "StdAfx.h"
#include "AnimationRotateScrambledEggs.h"

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

CAnimationRotateScrambledEggs::CAnimationRotateScrambledEggs(void)
{
	m_time = 0;
	m_increment = 0;
}

CAnimationRotateScrambledEggs::~CAnimationRotateScrambledEggs(void)
{
}

void CAnimationRotateScrambledEggs::Update(void)
{
	m_time++;
	m_time %= 500;

	if((m_time >= 0) && (m_time < 10))
	{
		m_increment = 0;
	}
	else if ((m_time >= 10) && (m_time < 20))
	{
		m_increment += 1;
	}
	else if ((m_time >= 20) && (m_time < 480))
	{
		m_increment = 10;
	}
	else
	{
		m_increment -= 1;
	}
		
	m_node->SetAngle(m_node->GetAngle() + m_increment);
}